package com.csw.xuxianParent.xuxianUser.handler;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import com.csw.xuxianParent.xuxianCommon2.utils.JwtUtil;

import io.jsonwebtoken.Claims;

@Component
public class JwtHandler implements HandlerInterceptor {

	@Autowired
	private JwtUtil jwtUtil;

	@Override
	public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler)
			throws Exception {
		// System.out.println("经过JWT拦截器");
		String headerToken = request.getHeader("AuthorToken");
		// System.out.println("userjwt=====>" + headerToken);
		if (headerToken != null && headerToken.startsWith("ChaoFan ")) {
			String token = headerToken.substring(8);
			
		}
		return true;
	}
}
